package ch.usi.inf.pf2.alu.nodes;

/**
 * This is an identifier node, it implements the Ln function
 * 
 * @author Thomas Mantegazzi
 * 
 */

public class LnNode extends IdentifierNode {

	public LnNode(Node[] arguments) throws WrongNumberOfArgumentsException {
		super(arguments);
		if (arguments.length > 1) {
			throw new WrongNumberOfArgumentsException(
					"Error: 'ln()' expect only one argument: given <"
							+ arguments.length + "> arguments");
		}
	}

	protected double compute(double[] args) {
		return Math.log(args[0]);
	}

}